package com.kaifamiao.demo.d0729.am;

// TODO (隐藏   强制类型转换后 调用父类成员)
public class Demo {


    public static void main(String[] args) {
        /*
           继承 is a
          多态
         */

        Pet pet = new Dog();
//        pet = new Cat();
        pet.say();

        call(new Pet());
        call(new Dog());
        call(new Cat());
        call(new Pig());

        Person person = new Student();
        person = new Teacher();
        person = new Boy();
        person = new Girl();

        Object obj = new Dog();
        obj = new Person();



    }

    public static void call(Pet pet){
        pet.say();
    }

}
